package behavior.strategy;

abstract public class Duck {
    String name;
    FlyBehavior flyBehavior;

    public Duck(String name, FlyBehavior flyBehavior) {
        this.name = name;
        this.flyBehavior = flyBehavior;
    }

    public void display() {
        String s = this.getClass() +
                "name='" + name + '\'' +
                "fly=" + flyBehavior.fly();
        System.out.println(s);
    }
}
